import { createSlice } from "@reduxjs/toolkit";

// 初始化的数据
const initialState = {
  currentLanguage: "zh",
};

// 创建Slice
const languageSlice = createSlice({
  name:"language",
  initialState,
  reducers:{
    setCurrentLanguage(state,{payload}){
      state.currentLanguage = payload
    }
  }
})

// 导出action
export const { setCurrentLanguage } = languageSlice.actions
// 导出reducer
export default languageSlice.reducer
